home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9045 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Time in milliseconds?
  5. Date: 7 Mar 96 22:50:34 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.826239034@rscernix>
  8. References: <313F33E0.31CA@cs.tu-berlin.de>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <313F33E0.31CA@cs.tu-berlin.de> Tobias Scheffer <scheffer@cs.tu-berlin.de> writes:
  13.  
  14. >How, in a C program, can I get the time in milliseconds? 
  15.  
  16. You cannot.  The best C can offer you for benchmarking purposes is clock().
  17.  
  18. >I want to measure 
  19. >how much time a procedure takes, but the usual library functions return
  20. >only seconds, which is to rough. Borland C provides a private library 
  21. >function, but how about unix?
  22.  
  23. clock() is a standard C function (and the usual resolutions are in the
  24. 10..20 milliseconds range for most Unices).  I doubt Borland has
  25. something in the milliseconds range, most likely the real resolution of
  26. their function is 55 milliseconds.
  27.  
  28. Dan
  29. --
  30. Dan Pop
  31. CERN, CN Division
  32. Email: danpop@mail.cern.ch 
  33. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  34.